Xbasic

a5_ai_prompt Function

Syntax

c a5_ai_prompt(c namedresource, c prompt)

Arguments

namedresource

Named resource for specifying ai server to use, api key, model and settings.

prompt

Prompt to pass to the AI endpoint.

Returns

result

Text response from the endpoint, otherwise and error string with '#Error' prefix

Description

Request an AI response for a text prompt .

Example

? a5_ai_prompt("ollama_qwen3coder","What is the capital of france")
= " The capital city of France is Paris. "